home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / demos.idb / usr / demos / General_Demos / bzflag / startserver.z / startserver
Encoding:
Text File  |  1997-06-26  |  657 b   |  19 lines

  1. #!/usr/sbin/perl
  2.  
  3. $ENV{'DISPLAY'} = "localhost:0.0";
  4. $ENV{'HOME'} = "/tmp";
  5.  
  6. $running= `/usr/bin/ps -e | /usr/bin/grep bzfs`;
  7.  
  8. if ($running) {
  9.     open(CMD, "/usr/bin/X11/xconfirm -header \"Bzflag\" -B \"Stop Server\"  -t \"The bzflag network server is running.\"  -t \"Click stop to terminate.\" -icon info|");
  10. } else {
  11.      open(CMD, "/usr/demos/General_Demos/bzflag/bzfs>/dev/null&|");
  12.      close(CMD);
  13.      open(CMD, "/usr/bin/X11/xconfirm -header \"Bzflag\" -B \"Stop Server\"  -t \"The bzflag network server is running.\"  -t \"Click stop to terminate.\" -icon info|");
  14.          read(CMD, $out, 100);
  15.      close(CMD);
  16.      `/sbin/killall bzfs`;
  17.      exit 0;
  18. }
  19.